<template>
  <view class="container-about">
    <view class="bg-color">
      <image class="about-img" src="../../static/login/logo.jpg"></image>
      <view class="about-desc">天府市民云小程序 V2.0.0</view>
      <list-cell
        class="about-list"
        v-for="(item, i) in serverList"
        :key="i"
        @eventClick="goAbout(item.title)"
        :title="item.title"
        link
      ></list-cell>
    </view>
  </view>
</template>
<script lang="ts" setup>
  import listCell from '@/components/mix-list-cell.vue'
  import { msg } from '@/utils/tools'
  import { onLoad } from '@dcloudio/uni-app'
  import { ref } from 'vue'
  const serverList = ref([
    { title: '隐私政策', type: 1, clickType: 3 },
    { title: '服务协议', type: 1, clickType: 3 },
  ])

  onLoad(() => {
    // #ifdef MP-WEIXIN
    uni.showShareMenu({
      menus: ['shareAppMessage', 'shareTimeline'],
    })
    // #endif
  })

  const goAbout = (name: string) => {
    uni.navigateTo({
      url: '/pagePublic/public/protocol?name=' + name,
      success(res) {
        console.log('成功啦', res)
      },
      fail(err) {
        msg(err || '打开服务失败，请稍后再试！')
      },
    })
  }
</script>

<style lang="scss">
  .container-about {
    background-color: #408af7;
    border-radius: unset;
    height: 100%;
  }
  .bg-color {
    background-color: #fff;
    padding: 40px 16px;
    border-radius: 12px 12px 0 0;
    height: 100%;
    overflow-y: auto;
    text-align: center;
  }
  .about-img {
    width: 140px;
    height: 120px;
  }
  .about-desc {
    font-size: 15px;
    font-weight: 400;
    color: rgba(30, 38, 47, 0.8);
    margin: 20px 0 60px 0;
  }
  .about-list {
    text-align: left;
  }
</style>
